package com.redare.dev.smart.generator.service.constant;

import com.redare.dev.smart.generator.sdk.pojo.CodeGroup;
import com.redare.dev.smart.generator.sdk.pojo.CodeRoot;
import com.redare.dev.smart.generator.sdk.pojo.CodeTemplate;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.time.DateFormatUtils;

import java.util.*;

/**
 * 内置参数
 */
public class Defaults {


    public static Map<String, String> getDefaultVariables() {
        Map<String, String> context = new HashMap<>();
        Calendar calendar = Calendar.getInstance();
        context.put("YEAR", String.valueOf(calendar.get(Calendar.YEAR)));
        context.put("MONTH", String.valueOf(calendar.get(Calendar.MONTH) + 1));
        context.put("DAY", String.valueOf(calendar.get(Calendar.DAY_OF_MONTH)));
        context.put("DATE", DateFormatUtils.format(calendar.getTime(), "yyyy-MM-dd"));
        context.put("TIME", DateFormatUtils.format(calendar.getTime(), "HH:mm:ss"));
        context.put("NOW", DateFormatUtils.format(calendar.getTime(), "yyyy-MM-dd HH:mm:ss"));
        context.put("USER", System.getProperty("user.name"));
        return context;
    }

    /**
     * 获取默认的模板
     */
    public static List<CodeRoot> getDefaultTemplates(){
        // 设置默认分组和模板
        List<CodeGroup> groups = new ArrayList<>();//普通项目模板
        List<CodeGroup> groups2 = new ArrayList<>();//纯后端(配合ant_design)模板
        List<CodeGroup> mesGroup = new ArrayList<>();//纯后端(配合ant_design)模板

        try {

            List<CodeTemplate> templates1 = new ArrayList<>();
            templates1.add(new CodeTemplate(UUID.randomUUID().toString(), "Model", "java", "${model}", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ModelTemplate.vm")), "pojo", false));
            templates1.add(new CodeTemplate(UUID.randomUUID().toString(), "ModelForm", "java", "${model}Form", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ModelFormTemplate.vm")), "pojo/form", false));
            templates1.add(new CodeTemplate(UUID.randomUUID().toString(), "Sdk", "java", "${model}Sdk", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/SdkTemplate.vm")), "", false));
            templates1.add(new CodeTemplate(UUID.randomUUID().toString(), "Dao", "java", "${model}Dao", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/DaoTemplate.vm")), "dao", false));
            templates1.add(new CodeTemplate(UUID.randomUUID().toString(), "Service", "java", "${model}Service", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ServiceTemplate.vm")), "service", false));
            templates1.add(new CodeTemplate(UUID.randomUUID().toString(), "Impl", "java", "${model}SdkImpl", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/SdkImplTemplate.vm")), "impl", false));
            CodeGroup sdkGroup = new CodeGroup(UUID.randomUUID().toString(), "model-sdk", 1, templates1);
            groups.add(sdkGroup);

            List<CodeTemplate> templates2 = new ArrayList<>();
            templates2.add(new CodeTemplate(UUID.randomUUID().toString(), "ExtModel", "js", "${model}Model", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ExtModelTemplate.vm")), "model/${lowerCaseModel}", false));
            templates2.add(new CodeTemplate(UUID.randomUUID().toString(), "ExtPageStore", "js", "${model}PageStore", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ExtPageStoreTemplate.vm")), "store/${lowerCaseModel}", false));
            templates2.add(new CodeTemplate(UUID.randomUUID().toString(), "ExtManager", "js", "${model}Manager", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ExtManagerTemplate.vm")), "view/${lowerCaseModel}", false));
            templates2.add(new CodeTemplate(UUID.randomUUID().toString(), "ExtForm", "js", "${model}Form", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ExtFormTemplate.vm")), "view/${lowerCaseModel}", false));
            templates2.add(new CodeTemplate(UUID.randomUUID().toString(), "ExtGrid", "js", "${model}Grid", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ExtGridTemplate.vm")), "view/${lowerCaseModel}", false));
            templates2.add(new CodeTemplate(UUID.randomUUID().toString(), "ExtGridSelect", "js", "${model}Select", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ExtGridSelectVIewTemplate.vm")), "view/${lowerCaseModel}", false));
            templates2.add(new CodeTemplate(UUID.randomUUID().toString(), "ExtController", "js", "${model}Controller", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ExtControllerTemplate.vm")), "view/${lowerCaseModel}/controller", false));
            templates2.add(new CodeTemplate(UUID.randomUUID().toString(), "ExtFormController", "js", "${model}FormController", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ExtFormControllerTemplate.vm")), "view/${lowerCaseModel}/controller", false));
            templates2.add(new CodeTemplate(UUID.randomUUID().toString(), "ExtViewModel", "js", "${model}ViewModel", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ExtViewModelTemplate.vm")), "view/${lowerCaseModel}/viewmodel", false));
            CodeGroup extViewGroup = new CodeGroup(UUID.randomUUID().toString(), "manager-ext-grid-view", 2,  templates2);
            groups.add(extViewGroup);

            List<CodeTemplate> templatesTree2 = new ArrayList<>();
            templatesTree2.add(new CodeTemplate(UUID.randomUUID().toString(), "ExtModel", "js", "${model}Model", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ExtModelTemplate.vm")), "model/${lowerCaseModel}", false));
            templatesTree2.add(new CodeTemplate(UUID.randomUUID().toString(), "ExtTreeStore", "js", "${model}TreeStore", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ExtTreeStoreTemplate.vm")), "store/${lowerCaseModel}", false));
            templatesTree2.add(new CodeTemplate(UUID.randomUUID().toString(), "ExtManager", "js", "${model}Manager", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ExtTreeManagerTemplate.vm")), "view/${lowerCaseModel}", false));
            templatesTree2.add(new CodeTemplate(UUID.randomUUID().toString(), "ExtForm", "js", "${model}Form", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ExtFormTemplate.vm")), "view/${lowerCaseModel}", false));
            templatesTree2.add(new CodeTemplate(UUID.randomUUID().toString(), "ExtTree", "js", "${model}Tree", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ExtTreeTemplate.vm")), "view/${lowerCaseModel}", false));
            templatesTree2.add(new CodeTemplate(UUID.randomUUID().toString(), "ExtTree", "js", "${model}Select", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ExtTreeSelectVIewTemplate.vm")), "view/${lowerCaseModel}", false));
            templatesTree2.add(new CodeTemplate(UUID.randomUUID().toString(), "ExtTreeController", "js", "${model}TreeController", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ExtTreeControllerTemplate.vm")), "view/${lowerCaseModel}/controller", false));
            templatesTree2.add(new CodeTemplate(UUID.randomUUID().toString(), "ExtFormController", "js", "${model}FormController", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ExtFormControllerTemplate.vm")), "view/${lowerCaseModel}/controller", false));
            templatesTree2.add(new CodeTemplate(UUID.randomUUID().toString(), "ExtTreeViewModel", "js", "${model}ViewModel", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ExtTreeViewModelTemplate.vm")), "view/${lowerCaseModel}/viewmodel", false));
            CodeGroup extTreeViewGroup = new CodeGroup(UUID.randomUUID().toString(), "manager-ext-tree-view", 2,  templatesTree2);
            groups.add(extTreeViewGroup);

            List<CodeTemplate> templates3 = new ArrayList<>();
            templates3.add(new CodeTemplate(UUID.randomUUID().toString(), "ManagerController", "java", "${model}Controller", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ControllerTemplate.vm")), "controller", false));
//            templates3.add(new CodeTemplate(UUID.randomUUID().toString(), "ManagerController", "java", "CommonController", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/CommonControllerTemplate.vm")), "controller", false));
            CodeGroup managerGroup = new CodeGroup(UUID.randomUUID().toString(), "manager-controller", 2,  templates3);
            groups.add(managerGroup);


            List<CodeTemplate> templates5 = new ArrayList<>();
            List<CodeTemplate> templatesMes5 = new ArrayList<>();
            templates5.add(new CodeTemplate(UUID.randomUUID().toString(), "Dao", "java", "${model}Dao", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/DaoTemplate.vm")), "dao", false));
            templates5.add(new CodeTemplate(UUID.randomUUID().toString(), "Service", "java", "${model}Service", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ServiceTemplate.vm")), "service", false));
            templates5.add(new CodeTemplate(UUID.randomUUID().toString(), "Impl", "java", "${model}SdkImpl", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/SdkImplTemplate.vm")), "impl", false));
            CodeGroup sdkImplGroup = new CodeGroup(UUID.randomUUID().toString(), "sdk-impl", 1, templates5);
            groups2.add(sdkImplGroup);


            templatesMes5.add(new CodeTemplate(UUID.randomUUID().toString(), "Dao", "java", "${model}Dao", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant-pro/java/DaoTemplate.vm")), "dao", false));
            templatesMes5.add(new CodeTemplate(UUID.randomUUID().toString(), "Service", "java", "${model}Service", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ServiceTemplate.vm")), "service", false));
            templatesMes5.add(new CodeTemplate(UUID.randomUUID().toString(), "Impl", "java", "${model}SdkImpl", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/SdkImplTemplate.vm")), "impl", false));
            CodeGroup sdkImplMesGroup = new CodeGroup(UUID.randomUUID().toString(), "sdk-impl", 1, templatesMes5);
            mesGroup.add(sdkImplMesGroup);



            List<CodeTemplate> templates6 = new ArrayList<>();
            templates6.add(new CodeTemplate(UUID.randomUUID().toString(), "Model", "java", "${model}", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ModelTemplate.vm")), "pojo", false));
            templates6.add(new CodeTemplate(UUID.randomUUID().toString(), "ModelForm", "java", "${model}Form", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ModelFormTemplate.vm")), "pojo/form", false));
            templates6.add(new CodeTemplate(UUID.randomUUID().toString(), "Sdk", "java", "${model}Sdk", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/SdkTemplate.vm")), "", false));
            CodeGroup oneSdkGroup = new CodeGroup(UUID.randomUUID().toString(), "sdk", 1, templates6);
            groups2.add(oneSdkGroup);


            List<CodeTemplate> templatesMes6 = new ArrayList<>();
            templatesMes6.add(new CodeTemplate(UUID.randomUUID().toString(), "Model", "java", "${model}", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant-pro/java/ModelTemplate.vm")), "pojo", false));
            templatesMes6.add(new CodeTemplate(UUID.randomUUID().toString(), "ModelForm", "java", "${model}Form", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant-pro/java/ModelFormTemplate.vm")), "pojo/form", false));
            templatesMes6.add(new CodeTemplate(UUID.randomUUID().toString(), "Sdk", "java", "${model}Sdk", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/SdkTemplate.vm")), "", false));
            CodeGroup oneSdkMesGroup = new CodeGroup(UUID.randomUUID().toString(), "sdk", 1, templatesMes6);
            mesGroup.add(oneSdkMesGroup);



            List<CodeTemplate> templates8 = new ArrayList<>();
            templates8.add(new CodeTemplate(UUID.randomUUID().toString(), "ManagerController", "java", "${model}Controller", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant/ControllerTemplate.vm")), "controller", false));
//            templates8.add(new CodeTemplate(UUID.randomUUID().toString(), "CommonController", "java", "CommonController", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant/CommonControllerTemplate.vm")), "controller", false));
            CodeGroup antManagerGroup = new CodeGroup(UUID.randomUUID().toString(), "manager-controller", 2,  templates8);
            groups2.add(antManagerGroup);
            mesGroup.add(antManagerGroup);


            List<CodeTemplate> templates9 = new ArrayList<>();
            templates9.add(new CodeTemplate(UUID.randomUUID().toString(), "NewManagerController", "java", "${model}Controller", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant/NewControllerTemplate.vm")), "controller", false));
//            templates9.add(new CodeTemplate(UUID.randomUUID().toString(), "CommonController", "java", "CommonController", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant/CommonControllerTemplate.vm")), "controller", false));
            CodeGroup newAntManagerGroup = new CodeGroup(UUID.randomUUID().toString(), "new-manager-controller", 2,  templates9);
            groups2.add(newAntManagerGroup);

            List<CodeTemplate> templates7 = new ArrayList<>();
            templates7.add(new CodeTemplate(UUID.randomUUID().toString(), "AntGrid", "js", "${model}Grid", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant/components/AntGridTemplate.vm")), "/components/${subPath}", false));
            templates7.add(new CodeTemplate(UUID.randomUUID().toString(), "AntSelectGrid", "js", "${model}SelectGrid", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant/components/AntSelectGridTemplate.vm")), "/components/${subPath}", false));
            templates7.add(new CodeTemplate(UUID.randomUUID().toString(), "AntSelect", "js", "${model}Select", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant/components/AntSelectTemplate.vm")), "/components/${subPath}", false));
            templates7.add(new CodeTemplate(UUID.randomUUID().toString(), "AntForm", "js", "${model}Form", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant/components/AntFormTemplate.vm")), "/components/${subPath}", false));
            templates7.add(new CodeTemplate(UUID.randomUUID().toString(), "AntSearchForm", "js", "${model}SearchForm", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant/components/AntSearchFormTemplate.vm")), "/components/${subPath}", false));
            templates7.add(new CodeTemplate(UUID.randomUUID().toString(), "AntPage", "js", "${model}Page", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant/AntMangePageTemplate.vm")), "pages/${subPath}", false));
            templates7.add(new CodeTemplate(UUID.randomUUID().toString(), "AntFormPage", "js", "${model}FormPage", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant/AntFormPageTemplate.vm")), "pages/${subPath}", false));
            templates7.add(new CodeTemplate(UUID.randomUUID().toString(), "AntInfoPage", "js", "${model}InfoPage", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant/AntInfoPageTemplate.vm")), "pages/${subPath}", false));
            CodeGroup antViewGroup = new CodeGroup(UUID.randomUUID().toString(), "manager-ant-grid-view", 2,  templates7);
            groups2.add(antViewGroup);

            List<CodeTemplate> templates11 = new ArrayList<>();
            templates11.add(new CodeTemplate(UUID.randomUUID().toString(), "AntGrid", "js", "${model}Grid", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant_new_presenter/components/AntGridTemplate.vm")), "/components/${subPath}", false));
            templates11.add(new CodeTemplate(UUID.randomUUID().toString(), "AntSelectGrid", "js", "${model}SelectGrid", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant_new_presenter/components/AntSelectGridTemplate.vm")), "/components/${subPath}", false));
            templates11.add(new CodeTemplate(UUID.randomUUID().toString(), "AntSelect", "js", "${model}Select", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant_new_presenter/components/AntSelectTemplate.vm")), "/components/${subPath}", false));
            templates11.add(new CodeTemplate(UUID.randomUUID().toString(), "AntForm", "js", "${model}Form", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant_new_presenter/components/AntFormTemplate.vm")), "/components/${subPath}", false));
            templates11.add(new CodeTemplate(UUID.randomUUID().toString(), "AntSearchForm", "js", "${model}SearchForm", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant_new_presenter/components/AntSearchFormTemplate.vm")), "/components/${subPath}", false));
            templates11.add(new CodeTemplate(UUID.randomUUID().toString(), "AntPage", "js", "${model}Page", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant_new_presenter/AntMangePageTemplate.vm")), "pages/${subPath}", false));
            templates11.add(new CodeTemplate(UUID.randomUUID().toString(), "AntFormPage", "js", "${model}FormPage", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant_new_presenter/AntFormPageTemplate.vm")), "pages/${subPath}", false));
            templates11.add(new CodeTemplate(UUID.randomUUID().toString(), "AntInfoPage", "js", "${model}InfoPage", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant_new_presenter/AntInfoPageTemplate.vm")), "pages/${subPath}", false));
            CodeGroup antViewPrGroup = new CodeGroup(UUID.randomUUID().toString(), "new-presenter-ant-view", 2,  templates11);
            groups2.add(antViewPrGroup);



            List<CodeTemplate> templatesAntPro = new ArrayList<>();
//            templatesAntPro.add(new CodeTemplate(UUID.randomUUID().toString(), "AntGrid", "js", "${model}Grid", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant-pro/components/AntGridTemplate.vm")), "pages/${subPath}/components", false));
//            templatesAntPro.add(new CodeTemplate(UUID.randomUUID().toString(), "AntSelectGrid", "js", "${model}SelectGrid", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant-pro/components/AntSelectGridTemplate.vm")), "pages/${subPath}/components", false));
//            templatesAntPro.add(new CodeTemplate(UUID.randomUUID().toString(), "AntSelect", "js", "${model}Select", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant-pro/components/AntSelectTemplate.vm")), "pages/${subPath}/components", false));
            templatesAntPro.add(new CodeTemplate(UUID.randomUUID().toString(), "AntForm", "js", "${model}Form", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant-pro/components/AntFormTemplate.vm")), "pages/${subPath}/components", false));
//            templatesAntPro.add(new CodeTemplate(UUID.randomUUID().toString(), "AntSearchForm", "js", "${model}SearchForm", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant-pro/components/AntSearchFormTemplate.vm")), "pages/${subPath}/components", false));
            templatesAntPro.add(new CodeTemplate(UUID.randomUUID().toString(), "AntPage", "js", "${model}Page", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant-pro/AntMangePageTemplate.vm")), "pages/${subPath}", false));
            templatesAntPro.add(new CodeTemplate(UUID.randomUUID().toString(), "AntFormPage", "js", "${model}FormPage", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant-pro/AntFormPageTemplate.vm")), "pages/${subPath}", false));
            templatesAntPro.add(new CodeTemplate(UUID.randomUUID().toString(), "AntInfoPage", "js", "${model}InfoPage", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant-pro/AntInfoPageTemplate.vm")), "pages/${subPath}", false));
            CodeGroup antViewProGroup = new CodeGroup(UUID.randomUUID().toString(), "ant-pro-components", 2,  templatesAntPro);

            mesGroup.add(antViewProGroup);


            List<CodeTemplate> templatesAntPro1 = new ArrayList<>();
//            templatesAntPro.add(new CodeTemplate(UUID.randomUUID().toString(), "AntGrid", "js", "${model}Grid", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant-pro/components/AntGridTemplate.vm")), "pages/${subPath}/components", false));
//            templatesAntPro.add(new CodeTemplate(UUID.randomUUID().toString(), "AntSelectGrid", "js", "${model}SelectGrid", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant-pro/components/AntSelectGridTemplate.vm")), "pages/${subPath}/components", false));
//            templatesAntPro.add(new CodeTemplate(UUID.randomUUID().toString(), "AntSelect", "js", "${model}Select", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant-pro/components/AntSelectTemplate.vm")), "pages/${subPath}/components", false));
            templatesAntPro1.add(new CodeTemplate(UUID.randomUUID().toString(), "AntTable", "js", "${model}Form", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant-pro/components/AntTableTemplate.vm")), "pages/${subPath}/components", false));
            templatesAntPro1.add(new CodeTemplate(UUID.randomUUID().toString(), "AntForm", "js", "${model}Form", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant-pro/components/AntFormTemplate.vm")), "pages/${subPath}/components", false));
//            templatesAntPro.add(new CodeTemplate(UUID.randomUUID().toString(), "AntSearchForm", "js", "${model}SearchForm", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant-pro/components/AntSearchFormTemplate.vm")), "pages/${subPath}/components", false));
            templatesAntPro1.add(new CodeTemplate(UUID.randomUUID().toString(), "AntPage", "js", "${model}Page", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant-pro/AntMangePageTemplate.vm")), "pages/${subPath}", false));
            templatesAntPro1.add(new CodeTemplate(UUID.randomUUID().toString(), "AntFormPage", "js", "${model}FormPage", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant-pro/AntFormPageTemplate.vm")), "pages/${subPath}", false));
            templatesAntPro1.add(new CodeTemplate(UUID.randomUUID().toString(), "AntInfoPage", "js", "${model}InfoPage", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/ant-pro/AntInfoPageTemplate.vm")), "pages/${subPath}", false));
            CodeGroup antViewProGroup1 = new CodeGroup(UUID.randomUUID().toString(), "ant-pro-components-table", 2,  templatesAntPro1);

            mesGroup.add(antViewProGroup1);



            List<CodeTemplate> templates12 = new ArrayList<>();
            templates12.add(new CodeTemplate(UUID.randomUUID().toString(), "AntGrid", "js", "${model}Grid", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/spreadjs/components/AntGridTemplate.vm")), "/components/${subPath}", false));
            templates12.add(new CodeTemplate(UUID.randomUUID().toString(), "AntSelectGrid", "js", "${model}SelectGrid", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/spreadjs/components/AntSelectGridTemplate.vm")), "/components/${subPath}", false));
            templates12.add(new CodeTemplate(UUID.randomUUID().toString(), "AntSelect", "js", "${model}Select", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/spreadjs/components/AntSelectTemplate.vm")), "/components/${subPath}", false));
            templates12.add(new CodeTemplate(UUID.randomUUID().toString(), "AntForm", "js", "${model}Form", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/spreadjs/components/AntFormTemplate.vm")), "/components/${subPath}", false));
            templates12.add(new CodeTemplate(UUID.randomUUID().toString(), "AntSearchForm", "js", "${model}SearchForm", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/spreadjs/components/AntSearchFormTemplate.vm")), "/components/${subPath}", false));
            templates12.add(new CodeTemplate(UUID.randomUUID().toString(), "AntPage", "js", "${model}Page", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/spreadjs/AntMangePageTemplate.vm")), "pages/${subPath}", false));
            templates12.add(new CodeTemplate(UUID.randomUUID().toString(), "AntFormPage", "js", "${model}FormPage", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/spreadjs/AntFormPageTemplate.vm")), "pages/${subPath}", false));
            templates12.add(new CodeTemplate(UUID.randomUUID().toString(), "AntInfoPage", "js", "${model}InfoPage", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/spreadjs/AntInfoPageTemplate.vm")), "pages/${subPath}", false));
            CodeGroup spreadJsViewGroup2 = new CodeGroup(UUID.randomUUID().toString(), "manager-spread-jisuan-view", 2,  templates12);
            groups2.add(spreadJsViewGroup2);

            List<CodeTemplate> templates10 = new ArrayList<>();
            templates10.add(new CodeTemplate(UUID.randomUUID().toString(), "AntGrid", "js", "${model}Grid", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/spreadjs_normal/components/AntGridTemplate.vm")), "/components/${subPath}", false));
            templates10.add(new CodeTemplate(UUID.randomUUID().toString(), "AntSelectGrid", "js", "${model}SelectGrid", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/spreadjs_normal/components/AntSelectGridTemplate.vm")), "/components/${subPath}", false));
            templates10.add(new CodeTemplate(UUID.randomUUID().toString(), "AntSelect", "js", "${model}Select", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/spreadjs_normal/components/AntSelectTemplate.vm")), "/components/${subPath}", false));
            templates10.add(new CodeTemplate(UUID.randomUUID().toString(), "AntForm", "js", "${model}Form", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/spreadjs_normal/components/AntFormTemplate.vm")), "/components/${subPath}", false));
            templates10.add(new CodeTemplate(UUID.randomUUID().toString(), "AntSearchForm", "js", "${model}SearchForm", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/spreadjs_normal/components/AntSearchFormTemplate.vm")), "/components/${subPath}", false));
            templates10.add(new CodeTemplate(UUID.randomUUID().toString(), "AntPage", "js", "${model}Page", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/spreadjs_normal/AntMangePageTemplate.vm")), "pages/${subPath}", false));
            templates10.add(new CodeTemplate(UUID.randomUUID().toString(), "AntFormPage", "js", "${model}FormPage", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/spreadjs_normal/AntFormPageTemplate.vm")), "pages/${subPath}", false));
            templates10.add(new CodeTemplate(UUID.randomUUID().toString(), "AntInfoPage", "js", "${model}InfoPage", IOUtils.toString(Defaults.class.getResourceAsStream("/templates/spreadjs_normal/AntInfoPageTemplate.vm")), "pages/${subPath}", false));
            CodeGroup spreadJsViewGroup = new CodeGroup(UUID.randomUUID().toString(), "manager-spread-js-view", 2,  templates10);
            groups2.add(spreadJsViewGroup);

        } catch (Exception e){
            e.printStackTrace();
        }
        // 设置默认根, 名称为root
        List<CodeRoot> roots = new ArrayList<>();
        roots.add(new CodeRoot(UUID.randomUUID().toString(), "mes-sdk-ant-view", mesGroup));
        roots.add(new CodeRoot(UUID.randomUUID().toString(), "sdk-ant-view", groups2));
        roots.add(new CodeRoot(UUID.randomUUID().toString(), "sdk-ext-manager-new", groups));
        return roots;
    }

}
